import { ILoadMapTypeAll } from '@/common';
import { getLevelZeroJson, getSelectDataCommon, getTenantID } from '@/utils';
import { AssetacquisitionManageAPI } from '../common/type';
/**
 * @param {Object} loadMdicMapList 数据字典
 * @param {Object} areaListData 地区字典
 * */
const ManageSearchColumns = (loadMdicMapList: Record<string, any>, areaListData: any[]): AssetacquisitionManageAPI.IHeaderSearchType => {
  /**作废类型数据字典*/
  const cancelTypeList = getSelectDataCommon(loadMdicMapList?.[`${getTenantID()}${ILoadMapTypeAll.MATERIAL_CANCEL}`], 'name', 'id');

  /**物料品牌数据字典*/
  const brandTypeList = getSelectDataCommon(loadMdicMapList?.[`${getTenantID()}${ILoadMapTypeAll.MATERIAL_BRAND}`], 'name', 'id');

  /**物料类型数据字典*/
  const materialTypeMapList = loadMdicMapList?.[`${getTenantID()}${ILoadMapTypeAll.MATERIAL_TYPE}`];
  const searchColumns: AssetacquisitionManageAPI.ISearchList = [
    {
      name: 'assetType',
      placeholder: '资产类型',
      label: '资产类型',
      componentType: 'Input',
      allowClear: true,
      md: 4,
      sm: 24,
      whetherSenior: false,
    },
    {
      name: 'asseterID',
      placeholder: '所属组织',
      label: '所属组织',
      componentType: 'Input',
      allowClear: true,
      md: 4,
      sm: 24,
      whetherSenior: false,
      treeID: 'id',
      treeName: 'name',
    },
    {
      name: 'data',
      placeholder: '统计维度',
      label: '统计维度',
      componentType: 'Select',
      allowClear: true,
      md: 4,
      sm: 24,
      whetherSenior: false,
      dataSource: [
        {
          name: '日',
          value: '0',
        },
        {
          name: '月',
          value: '1',
        },
        {
          name: '年',
          value: '2',
        },
      ],
      onSelect: () => {
        console.log(1232);
      },
    },
    {
      name: 'statisticalTime',
      placeholder: '统计时间',
      label: '统计时间',
      componentType: 'RangePicker',
      allowClear: true,
      md: 12,
      sm: 24,
      whetherSenior: false,
    },
  ];

  return searchColumns;
};

export { ManageSearchColumns };
